package com.cyandpos.pad.cateringformat.choosemenu.model;

import com.cyandpos.pad.posdata.DjdData;
import com.cyandpos.pad.posdata.Goods;
import com.cyandpos.pad.posdata.Member;
import com.cyandpos.pad.posdata.Order;
import com.cyandpos.pad.posdata.QueryGoodParam;
import com.cyandpos.pad.posdata.QueryMemberReq;
import com.cyandpos.pad.posdata.QueryOrderReq;
import com.cyandpos.pad.posdata.TicketInfo;

import java.util.List;

public interface QueryFoodModel {
    /**
     * 餐饮商品
     * @param shopid
     * @param listener
     */
    void loadQueryFood(String shopid, QueryFoodModelImpl.OnLoadQueryFoodListener listener);

    /**
     * 创建订单号
     * @param orderNo
     * @param listener
     */
    void createOrderNo(String orderNo, String tableNo ,String tablePerson,onCreateOrderNoListener listener);

    public interface onCreateOrderNoListener{
        void onCreateOrderNoSuccess(String orderNo);
        void onCreateOrderNoFailure(String errorMsg);
    }

    /**
     * 查询商品
     * @param ticketInfo
     * @param listener
     */
//    void queryGoods(String content, TicketInfo ticketInfo, int subInx, OnQueryGoodsInfoListener listener);
    void queryGoods(QueryGoodParam param, TicketInfo ticketInfo, int subInx, OnQueryGoodsInfoListener listener);

    public interface  OnQueryGoodsInfoListener{
        void onQueryGoodsInfoSuccess(Goods goods);
        void onQueryGoodsInfoFailure(String errorMsg);
    }

    /**
     *前台折扣查询
     * @param disType  折扣类型
     * @param money  折扣金额(折扣率)
     * @param goods   单品
     * @param orderNo  订单号
     * @param isSingle  是否单品折扣
     * @param listener
     */
    void frontDiscount(String disType, String money, Goods goods, String orderNo, boolean isSingle, OnFrontDiscountListener listener);

    public interface  OnFrontDiscountListener{
        void onFrontDiscountSuccess(List<Goods> goods, boolean isSingle);
        void onFrontDiscountFailure(String errorMsg);
    }

    /**
     * 会员查询
     * @param memberReq  请求需要的数据
     * @param listener
     */
    void queryMember(QueryMemberReq memberReq, OnQueryMemberListener listener);

    public interface  OnQueryMemberListener{
        void OnQueryMemberSuccess(Member member);
        void OnQueryMemberFailure(String errorMsg);
    }

    /**
     * 取消订单
     * @param orderNo  订单号
     * @param listener
     */
    void cancelOrder(String orderNo, onCancelOrderListener listener);

    public interface onCancelOrderListener{
        void onCancelOrderSuccess(String orderNo);
        void onCancelOrderFailure(String errorMsg);
    }

    /**
     *  准备付款及预算接口
     * @param ticketInfo 小票信息
     * @param isPromotion 是否调用为预算接口
     * @param listener
     */
    void onPreparePay(TicketInfo ticketInfo, boolean isPromotion, onPreparePayListener listener);

    public interface onPreparePayListener{
        void onPreparePaySuccess(TicketInfo ticketInfo, boolean isPromotion);
        void onPreparePayFailure(String errorMsg);
    }

    /**
     * 查询订单
     * @param req
     * @param onQueryOrderListener
     */
    void QueryOrderInfoEexcute(QueryOrderReq req,onQueryOrderListener onQueryOrderListener);

    public interface onQueryOrderListener{
        void onQueryOrderSuccess(List<Order> orderList, double orderCount);
        void onQueryOrderFailure(String errorMsg);
    }
}
